package model;

import java.util.ArrayList;
import java.util.List;

import common.DataManager;

/**
 * @author Colin
 * 
 * The DamageUpgrade class is a type of upgrade that 
 * improves the damage of all of the weapons.
 *
 */
public class DamageUpgrade extends Upgrade{

	private static final int COST = 2000;
	private static final int DAMAGE_UPGRADE = 2;
	
	public DamageUpgrade(){
		super("Damage Upgrade", DataManager.DAMAGE_UPGRADE, COST);
	}
	
	@Override
	public void applyUpgrade(){
		ArrayList<AutomaticWeapon> weapons = this.map.getWeaponsOnMap();
		for (int i = 0; i < weapons.size(); ++i){
			Weapon curWeapon = weapons.get(i);
			curWeapon.setDamage(curWeapon.getDamage() + DAMAGE_UPGRADE);
			System.out.println("Weapon #"+i+" has "+curWeapon.getDamage()+" damage");
		}
	}

	@Override
	public String getDescription() {
		return "Doubles the damage dealt by all automatic weapons currently on the map";
	}

}
